//
//  Picture.m
//  CarHome
//
//  Created by lanou3g on 15-5-1.
//  Copyright (c) 2015年 lanou3g. All rights reserved.
//

#import "Picture.h"
#import "PicCategory.h"
#import "PicColor.h"
#import "PicDefault.h"
#import "PicSpecification.h"
#import "PicList.h"

@implementation Picture

- (instancetype)init
{
    self = [super init];
    if (self) {
        _categorylist = [[NSMutableArray alloc] initWithCapacity:0];
        _colorlist = [[NSMutableArray alloc] initWithCapacity:0];
        _defaultpiclist = [[NSMutableArray alloc] initWithCapacity:0];
        _piclist = [[NSMutableArray alloc] initWithCapacity:0];
        _speclist = [[NSMutableArray alloc] initWithCapacity:0];
    }
    return self;
}

- (void)setCategorylist:(NSMutableArray *)categorylist {
    for (NSMutableDictionary *item in categorylist) {
        PicCategory *pc = [[PicCategory new] autorelease];
        [pc setValuesForKeysWithDictionary:item];
        [_categorylist addObject:pc];
    }
}

- (void)setColorlist:(NSMutableArray *)categorylist {
    for (NSMutableDictionary *item in categorylist) {
        PicColor *pc = [[PicColor new] autorelease];
        [pc setValuesForKeysWithDictionary:item];
        [_colorlist addObject:pc];
    }
}

- (void)setDefaultpiclist:(NSMutableArray *)defaultpiclist {
    for (NSMutableDictionary *item in defaultpiclist) {
        PicDefault *pd = [[PicDefault new] autorelease];
        [pd setValuesForKeysWithDictionary:item];
        [_defaultpiclist addObject:pd];
    }

}

- (void)setSpeclist:(NSMutableArray *)categorylist {
    for (NSMutableDictionary *item in categorylist) {
        PicSpecification *ps = [[PicSpecification new] autorelease];
        [ps setValuesForKeysWithDictionary:item];
        [_speclist addObject:ps];
    }
}

- (void)setPiclist:(NSMutableArray *)piclist {
    for (NSMutableDictionary *item in piclist) {
        PicList *pc = [[PicList new] autorelease];
        [pc setValuesForKeysWithDictionary:item];
        [_piclist addObject:pc];
    }
}

@end
